package com.conan.array.exer1;/** * @version 加油！！！ * @Description     数组的扩容{1，2，3，4，5}，扩容一倍并且把10，20，30放进去 * @Author 谷藤新一GYC * @Date 2023/7/30-10:22 */public class ArrayTest9 {    public static void main(String[] args) {        int [] arr = new int[]{1,2,3,4,5};        //int [] newArr = new int [arr.length*2];        int [] newArr = new int[arr.length << 1];        for(int i = 0;i < arr.length;i++){            newArr[i] = arr[i];        }        newArr[arr.length] = 10;        newArr[arr.length+1] = 20;        newArr[arr.length+2] = 30;        arr = newArr;        for (int i = 0; i < arr.length; i++) {            System.out.print(arr[i]+"\t");        }    }}   